package com.me.common.constant;


import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

/**
 * @author jindouyun
 */
public final class GlobalManager {


    private GlobalManager() {
    }


    public static class Config {

        //MQ
        public static final String CSX_B2B_SSS_EVENT_DRIVER_TOPIC = "sss_event_driver_topic";
    }

    public static final LocalDateTime TIME_MAX = LocalDateTime.of(9999, 12, 31, 23, 59, 59);

    public static final String SUCCESS = "success";
    public static final String NUO_NUO_SUCCESS = "0000";

    public static final String SYS_CODE = "TASK-SCHEDULING";
    public static final String SSS_REPORT_TASK_TYPE = "csx-b2b-sss-schedul";

    public static final int MAX_REPORT_PROGRESS = 1000;

    public static final int REPORT_MAX_SIZE = 500000;


    public static final int REPORT_PAGE_SIZE = 10000;

    public static final int COMMON_SUCCESS_CODE = 200000;

    public static final String UNIT_KG = "KG";

    public static final String STR_ONE = "1";
    public static final String STR_FIVE = "5";

    public static final String STR_NEGATIVE_ONE = "-1";

    public static final String MAPPER_PACKAGE = "com.yh.csx.sss.dao.mapper";

    public static final String TIME_BEGIN = " 00:00:00";

    public static final String TIME_END = " 23:59:59";

    public static final String COMMA = ",";

    public static final String ENTER = "\n";

    public static final String BLANK = " ";

    public static final String EMPTY = "";

    public static final String SYS = "sys";

    public static final String ADMIN = "管理员";

    public static final String BAR = "-";

    public static final String UNDERLINE = "_";

    public static final String VERTICAL_LINE = "|";

    public static final String AES = "AES";

    /**
     * 导出锁
     */
    public static final String SSS_EXPORT_EXCEL_LOCK = "sss_export_excel_lock";

    public static String getGroupKey(String interval, String... args) {
        return String.join(interval, Arrays.asList(args));
    }

    public static String concat(Object... args) {
        StringBuilder builder = new StringBuilder(EMPTY);
        for (Object s : args) {
            builder.append(s);
        }
        return builder.toString();
    }

    public static String concatByBar(Object... args) {
        StringBuilder builder = new StringBuilder(EMPTY);
        for (int i = 0; i < args.length; i++) {
            if (i == args.length - 1) {
                builder.append(args[i]);
            } else {
                builder.append(args[i]).append(BAR);
            }
        }

        return builder.toString();
    }


    public static class DatePattern {

        public static final String YYYYMMDD = "yyyy-MM-dd";

        public static final String YYYYMM = "yyyy-MM";

        public static final String YYYYMMDDHHMMSS = "yyyy-MM-dd HH:mm:ss";

        public static final String YYMMDD = "yyMMdd";

        public static final String YYYYMMDD2 = "yyyyMMdd";

        public static final String YYYYMMDDHHMMSS2 = "yyyyMMddHHmmss";


    }
}
